import applicationAdminApiConfig from '@/core/application/generated/apiconfig/applicationAdminApiConfig'
import serverApiMockUtils from '../../utils/serverApiMockUtils'
import mockProdServerUtils from '../../utils/mockUtils'
import { MockMethod } from 'vite-plugin-mock'
import Mock from 'mockjs'
import AppApplicationOauth2ClientResponse from '@/core/application/generated/types/model/response/AppApplicationOauth2ClientResponse'

const content: AppApplicationOauth2ClientResponse[] = []
for (let i = 0; i < 10; i++) {
	content.push({
		id: i.toString(),
		appId: i.toString(),
		key: `key_应用与oauth2客户端关联_${i.toString()}`,
		idOfClient: i.toString(),
		title: `title_应用与oauth2客户端关联_${i.toString()}`,
		remark: `remark_应用与oauth2客户端关联_${i.toString()}`,
		attributes: `attributes_应用与oauth2客户端关联_${i.toString()}`,
		iamAppId: i.toString(),
		upmsAppId: Mock.Random.integer(1, 2) == 1 ? null : i.toString(),
		deleteFlag: '0',
		createTime: new Date().getTime().toString(),
		updateTime: new Date().getTime().toString(),
		rowVersion: 1,
	} as AppApplicationOauth2ClientResponse)
}

const mockList: MockMethod[] = [
	...serverApiMockUtils.getDefaultServerApi(applicationAdminApiConfig.appApplicationOauth2Client, content),
]

mockProdServerUtils.addMockList(...mockList)

export const items = content
